﻿namespace Example
{
    using System.ComponentModel;
    using System.Configuration.Install;
    using System.Diagnostics;

    /// <summary>
    /// Represents a ApplicationEventSource.
    /// <para>This class cannot be inherited.</para>
    /// </summary>
    /// <remarks>
    /// <see href="http://support.microsoft.com/kb/329291">
    /// PRB: "Requested Registry Access Is Not Allowed" Error Message When ASP.NET Application Tries to Write New EventSource in the EventLog
    /// </see>
    /// </remarks>
    [RunInstaller(true)]
    public sealed class ApplicationEventSourceInstaller : Installer
    {
        public ApplicationEventSourceInstaller()
        {
            var installer = new EventLogInstaller
            {
                Source = "Example Company",
                Log = "Application"
            };

            Installers.Add(installer);
        }
    }
}